#ifndef G1_OBJECT_HPP
#define G1_OBJECT_HPP
#include <cstddef>
class Klass
{
    public:
        size_t reference_field_count;
};


struct ObjectHeader
{
    size_t size;
    int mark_epoch;
    bool is_marked;
    void* klass_pointer;
};

class G1Object
{
  private:
    ObjectHeader header;
  public:
    static G1Object* from_address(void* address)
    {
        return reinterpret_cast<G1Object*>(address);
    }

    bool is_marked_in_epoch(int epoch)
    {
        return header.is_marked && header.mark_epoch == epoch;
    }
    void mark_in_epoch(int epoch)
    {
        header.is_marked = true;
        header.mark_epoch = epoch;
    }
    ObjectHeader& get_header()
    {
        return header;
    }
};
#endif // G1_OBJECT_HPP

